package com.social.socialservice.controller;

import com.social.socialservice.dal.GlobalDAL;
import com.social.socialservice.model.I18nInfo;
import com.social.socialservice.unit.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 国际化相关操作控制器
 */
@RestController
@CrossOrigin
public class GlobalController {
    @Autowired
    GlobalDAL globalDAL;

    /**
     * 查询国际化
     * 根据当前用户所在区域进行查询
     */
    @RequestMapping(value = "/getGlobalLanguageByArea", method = RequestMethod.POST, produces = "application/json; utf-8")
    public Response getGlobalLanguageByArea(@RequestBody I18nInfo i18nInfo){
        return globalDAL.getGlobalLanguageByArea(i18nInfo);
    }

    /**
     * 查询国际化列表用于设置
     */
    @RequestMapping(value = "/getGlobaLanguageList", method = RequestMethod.POST, produces = "application/json; utf-8")
    public Response getGlobaLanguageList(){
        return globalDAL.getGlobaLanguageList();
    }
}
